package com.briup.item.controller;

import com.briup.common.response.Result;
import com.briup.item.domain.vo.CategoryGetListVO;
import com.briup.item.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 分类
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 获取所有类别
     *
     * @return {@link Result }
     */
    @GetMapping("/getAll")
    public Result getAllCategory(){
        List<CategoryGetListVO> categoryList = categoryService.getAllCategory();
        return Result.success(categoryList);
    }
}
